package com.koal.controller;

import com.alibaba.nacos.api.config.annotation.NacosValue;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/config")
public class ConfigController {

    //需要先在nacos上创建文件，并写上something: helloworld
    @NacosValue(value = "${something:false}", autoRefreshed = true)
    private String something;

    @ResponseBody
    @RequestMapping("/something")
    public String getSomething() {
        return something;
    }
}
